package com.boco.wmworkflow.common.xmlmodel;

import java.util.*;
import com.boco.common.util.xml.*;
import com.boco.webmaster.common.xsdmap.workflow.wfsheet.*;

public class WfSheetXmlModel extends AbstractXmlModel{
    private Map sheetItemMap = new HashMap();
    public WfSheetXmlModel(String xmlFileName) throws Exception{
        super("com.boco.webmaster.common.xsdmap.workflow.wfsheet", xmlFileName);
        List itemList = getSheetItemList();
        for(int i=0; i<itemList.size(); i++){
            SheetItemType item = (SheetItemType)itemList.get(i);
            sheetItemMap.put(item.getItemId(), item);
        }
    }

    private WfSheetModelType getXmlRootModel(){
        return (WfSheetModelType) super.getRootModel();
    }

    public String getXltFilePath(){
        return getXmlRootModel().getXsltName();
    }

    public List getSheetItemList(){
        return  getXmlRootModel().getSheetItemList();
    }

    public SheetItemType getSheetItem(String sheetItemId){
        return (SheetItemType) sheetItemMap.get(sheetItemId);
    }
}
